package com.easyim.rest.config;

import org.neo4j.driver.AuthTokens;
import org.neo4j.driver.Driver;
import org.neo4j.driver.GraphDatabase;
import org.neo4j.driver.Session;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class Neo4jSession {

    @Bean
    public Session myNeo4jSession(){
        // Neo4j数据库的连接信息
        String uri = "bolt://localhost:7687"; // Neo4j数据库的URI
        String username = "neo4j";    // 您的用户名
        String password = "password";    // 您的密码

        // 创建一个Neo4j驱动程序会话
        Driver driver = GraphDatabase.driver(uri, AuthTokens.basic(username, password));
        Session session = driver.session();
        return session;
    }

}
